package edu.hhu.controller;

import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSON;
import com.jfinal.core.Controller;
import com.jfinal.ext.render.excel.PoiRender;

import edu.hhu.dynamic.table.TableService;
import tree.TreeService;

public class TableController extends Controller{
	public void showTable() {
		String nodeStr=this.getPara("nodeStr");
		try{
			nodeStr = URLDecoder.decode(nodeStr, "UTF-8");
		}catch(Exception e){
			e.printStackTrace();
		}
//		System.out.println(nodeStr);
		nodeStr=nodeStr.substring(0, nodeStr.length()-1);
		
		String fieldStr=this.getPara("fieldStr");
		fieldStr=fieldStr.substring(0, fieldStr.length()-1);
		
		String s_date=this.getPara("s_date");
		String e_date=this.getPara("e_date");

		TableService tableservice=new TableService();
		String json=tableservice.getData(nodeStr, fieldStr, s_date, e_date);
		//System.out.println(json);
		renderJson(json);
	}
	
	

}
